package com.kgc.cgapi.service;

import com.kgc.basic.util.ResponseMsg;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

public interface PurchaseInvoiceRemote {

    //分页查询采购发票
    @RequestMapping("/selectPurchaseInvoiceByPage")
    @ResponseBody
    ResponseMsg selectPurchaseInvoiceByPage(@RequestBody Map<String, Object> map);

    //新增采购发票
    @RequestMapping("insertPurchaseInvoice")
    @ResponseBody
    ResponseMsg insertPurchaseInvoice(@RequestBody Map<String, Object> map);

    //根据供应商（pid）查询对应采购入库单
    @RequestMapping("selectPurchaseInstoreByPid")
    @ResponseBody
    ResponseMsg selectPurchaseInstoreByPid(@RequestParam("supplierId") int supplierId);

    //
    @RequestMapping("selectPurchaseInstoreDetailByInstoreCode")
    @ResponseBody
    ResponseMsg selectPurchaseInstoreDetailByInstoreCode(@RequestParam("instoreCode") String instoreCode);

    //根据单据编号查询采购发票(回显)
    @RequestMapping("selectPurchaseInvoiceByCode")
    @ResponseBody
    ResponseMsg selectPurchaseInvoiceByCode(@RequestParam("code") String code);

    //根据单据编号查询采购发票(回显)
    @RequestMapping("selectPurchaseInvoiceDetailByCode")
    @ResponseBody
    ResponseMsg selectPurchaseInvoiceDetailByCode(@RequestParam("invoiceCode") String invoiceCode);

    //删除采购发票
    @RequestMapping("deletePurchaseInvoice")
    @ResponseBody
    ResponseMsg deletePurchaseInvoice(@RequestParam("id") int id);

    //根据单据编号删除主表数据
    @RequestMapping("deletePurchaseInvoiceByCode")
    @ResponseBody
    ResponseMsg deletePurchaseInvoiceByCode(@RequestParam("code") String code);

    //根据关联的单据编号删除明细表数据
    @RequestMapping("deletePurchaseInvoiceDetailByCode")
    @ResponseBody
    ResponseMsg deletePurchaseInvoiceDetailByCode(@RequestParam("code") String code);


}
